import Vue from 'vue'
import VueRouter from 'vue-router'


import restaurant from './restaurant/index'
import usermanager from './usermanager/index'


Vue.use(VueRouter)

const routes=[
  {path:'',redirect:'/home'},
  {path:'/home',  component:()=>import("../view/menu/index.vue"),
  children:[
    {
      path:'home',
      component:()=>import('../view/menu/home.vue')
    },
    {
      path:'',
      redirect:'restaurant'
    },
    restaurant,
    usermanager,
    {
      name:'addResturant',
      path:'addResturant',
      component:()=>import('../view/restaurant/addresturant/addresturant.vue')
    },
    {
      name:'foodManager',
      path:'foodManager',
      component:()=>import('../view/foodManager/foodManager.vue')
    },
    {
      name:'addShop',
      path:'addShop',
      component:()=>import('../view/commodity/addShop.vue')
    },
    {
      name:'commodity',
      path:'commodity',
      component:()=>import('../view/commodity/commodity.vue')
    }
    
  ]


}

]
const router= new VueRouter({
  mode:'history',
  routes
})
export default router